<template>
  <form @submit.prevent>
    <div>
      身高：<input type="text" v-model="bmiForm.height">
    </div>
    <div>
      体重：<input type="text" v-model="bmiForm.weight">
    </div>
    <div>
      <button @click="handleSubmit">提交</button>
    </div>
  </form>
</template>

<script>
export default {
  name: "BMIForm",
  data() {
    return {
      bmiForm: {
        height: "",
        weight: ""
      },
    }
  },
  methods: {
    handleSubmit() {
      // console.log(this.bmiForm)
      // this.$emit("自定义事件名", "参数")
      this.$emit("submit-data", this.bmiForm)
    }
  }
}
</script>
